package com.xjc.business.controller.colladmin;

import com.xjc.business.entity.vo.coladmin.CheckBedReportVo;
import com.xjc.business.service.CheckBedBackService;
import com.xjc.system.constants.MyConstants;
import com.xjc.system.exception.MyException;
import com.xjc.system.result.Result;
import com.xjc.system.result.ResultCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 徐锦程
 * 时间:2025-03-11 11:09
 */
@RestController
@RequestMapping("/college_admin/check_bed")
public class CollegeCheckBedController {

    @Autowired
    CheckBedBackService checkBedBackService;

    /**
     * 获取宿舍检查报告列表
     * @param id 学院管理员id
     * @return
     */
    @GetMapping("/get_check_bed_report_list/{id}")
    public Result<List<CheckBedReportVo>> getCheckBedReportList(@PathVariable(required = false, name = "id") Integer id){
        if(id == null){
            throw new MyException(ResultCode.SUCCESS.getCode(), MyConstants.PARAM_MISSING);
        }

        return checkBedBackService.getCheckBedReportList(id);
    }
}